package com.woniu.darryringmall.admin.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.woniu.darryringmall.front.entity.Comment;
import com.woniu.darryringmall.front.service.CommentService;
import com.woniu.darryringmall.utils.ResponseData;
import com.woniu.darryringmall.utils.ResultStateCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController("adminController")
@RequestMapping("admin/comment")
public class CommentController {

    @Autowired
    private CommentService commentService;

   @GetMapping("delete/{id}")
    public ResponseData delete(@PathVariable("id") int id){
       boolean flag = commentService.removeById(id);
       if (!flag){
           return new ResponseData(ResultStateCode.FAIL,"删除失败");
       }
       return new ResponseData(ResultStateCode.SUCCESS,"删除成功");
   }

}
